/**
 * 
 */
package com.yidu.drug.action;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yidu.drug.common.Tools;
import com.yidu.drug.model.DrugManagerModel;
import com.yidu.drug.model.InventoryModel;
import com.yidu.drug.service.InventoryService;

/**
 * 库存明细Action
 * @author tanglei
 * @date 2018年8月22日 下午4:49:13
 * @version 1.0
 */
@Controller
@RequestMapping("/Inventory")
public class InventoryAction {
	//注入库存明细Service
	@Resource
	private InventoryService inventoryService;
	
	/**
	 * 根据库存ID查询库存明细数据
	 * @param inventory 传入一个库存明细对象
	 * @return 返回一个map集合
	 */
	@RequestMapping("/findByRepId")
	@ResponseBody
	public Map<String,Object> findByRepId(InventoryModel inventory){
		//调用库存明细service里面的根据库存ID查询的方法，并返回
		return inventoryService.findByRepId(inventory);
	}
	@RequestMapping("/findByfilId")
	@ResponseBody
	public List<InventoryModel> findByFilIdDrug(HttpSession session, String drugId) {
		DrugManagerModel manager=(DrugManagerModel) session.getAttribute("manager");
		
		List<InventoryModel> listOne=inventoryService.findByFilIdDrug("1", drugId);
		
		return listOne;
	}
}
